//
//  SFCRevision.h
//  SVNForCocoa
//
//  Created by Jeremy Pereira on 12/11/2013.
//  Copyright (c) 2013 Jeremy Pereira. All rights reserved.
//
/*!
 *    @file
 *    @brief Declarations associated with an SFCRevision.
 */

#import <Foundation/Foundation.h>
#import "SFCObject.h"
#import "SFCClient.h"

/*!
 *    @brief Encapsulates an SVN opt revision.
 *
 *    Revisions have a kind and optionally a value that qualifies the kind.
 *
 *    For instance, the kind might be head, with no qualifying value needed or
 *    date with a date needed.
 */
@interface SFCRevision : SFCObject
/*!
 *    @brief Return a revision of unspecified kind, no value is needed.
 *
 *    @return A revision of unspecified kind.
 */
+(SFCRevision*) unspecified;
/*!
 *    @brief Revision of most recent change
 *
 *    @return Revision
 */
+(SFCRevision*) committed;
/*!
 *    @brief committed revision - 1
 *
 *    @return Revision
 */
+(SFCRevision*) previous;
/*!
 *    @brief revision of working copy base
 *
 *    @return Revision
 */
+(SFCRevision*) base;
/*!
 *    @brief current wc revision + mods
 *
 *    @return Revision
 */
+(SFCRevision*) working;
/*!
 *    @brief Youngest revision in the repository.
 *
 *    @return Revision
 */
+(SFCRevision*) head;

/*!
 *    @brief Make a numerical revision
 *
 *    @param aNumber Revision number to use.
 *
 *    @return A numerical revision.
 */
+(SFCRevision*) number: (SFCRevNum) aNumber;

/*!
 *    @brief The numerical revision number of this revision.
 *
 *    Unless this is a numericl revision, the property is -1
 */
@property (readonly, assign) SFCRevNum number;
/*!
 *    @brief Make a date revision
 *
 *    @param aDate Date to use.
 *
 *    @return A date revision.
 */
+(SFCRevision*) date: (NSDate*) aDate;
/*!
 *    @brief The date of this revision.
 *
 *    Unless this is a date revision, the property is nil
 */
@property (readonly, strong) NSDate* date;


@end

/*!
 *    @brief Numerical revision.
 *
 *    This kind of revision has a revision number.
 */
@interface SFCNumericalRevision : SFCRevision

/*!
 *    @brief Designated initialiser.
 *
 *    @param aNumber Revision number for the revision.
 *
 *    @return a new numerical revision.
 */
-(id) initWithNumber: (SFCRevNum) aNumber;

@end

/*!
 *    @brief Date revision.
 *
 *    This is a revision by date.
 */
@interface SFCDateRevision : SFCRevision
/*!
 *    @brief Designated initialiser.
 *
 *    @param aDate date for the revision.
 *
 *    @return a new date revision.
 */
-(id) initWithDate: (NSDate*) aDate;

@end

/*!
 *    @brief Last committed revision number.
 */
@interface SFCCommittedRevision : SFCRevision
@end

/*!
 *    @brief Previous revision to last committed.
 */
@interface SFCPreviousRevision : SFCRevision
@end

/*!
 *    @brief Base revision of working copy.
 */
@interface SFCBaseRevision : SFCRevision
@end

/*!
 *    @brief Working copy + changes revision.
 */
@interface SFCWorkingRevision : SFCRevision
@end

/*!
 *    @brief Most recent revision in the repository.
 */
@interface SFCHeadRevision : SFCRevision
@end

/*!
 *    @brief Represents a revision range.
 */
@interface SFCRevisionRange : SFCObject

/*!
 *    @brief Create a revision range btween the two given revisions.
 *
 *    @param start First revision of range.
 *    @param end   Last revision in the range.
 *
 *    @return A revision range object.
 */
+(SFCRevisionRange*) rangeFrom: (SFCRevision*) start to: (SFCRevision*) end;

/*!
 *    @brief Star tof range.
 */
@property (nonatomic, readonly, strong) SFCRevision* start;
/*!
 *    @brief End of range.
 */
@property (nonatomic, readonly, strong) SFCRevision* end;

@end

